/*
 * @Author: xiaoxiaotaoya 1712331226@qq.com
 * @Date: 2024-12-22 14:14:56
 * @LastEditors: xiaoxiaotaoya 1712331226@qq.com
 * @LastEditTime: 2024-12-22 18:07:15
 * @FilePath: /trobot_ws/src/controller_modules/mc_path_planner/include/mc_path_planner/complete_coverage_path/ccpp_planner.h
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#ifndef __CCPP_PLANNER_H__
#define __CCPP_PLANNER_H__

#include <geometry_msgs/PointStamped.h>
#include <geometry_msgs/PolygonStamped.h>
#include <mc_path_planner/complete_coverage_path/ccpp_base.h>
#include <mc_path_planner/complete_coverage_path/edge_path.h>
#include <mc_path_planner/complete_coverage_path/sprial_path.h>
// 路径平滑
#include <mc_path_planner/path_smoother/five_point_gradient.h>

namespace ccpp{

class CompleteCoverPlanner{
    public:
        CompleteCoverPlanner(boost::shared_ptr<MapBase> map_handler_ptr);
        ~CompleteCoverPlanner();
        // 计算两点之间的欧几里得距离
        double calculateDistance(const Point2f& p1, const Point2f& p2);
        // 根据起点和终点生成等间距的点
        std::vector<Point2f> generateLinePoints(const Point2f& start, const Point2f& end, double interval);

        // 全覆盖路径生成 - 基于多边形轮廓
        bool genPathWithPolygon(geometry_msgs::Point start, vector<geometry_msgs::Point> polygon, PathType path_type, CoveragePath& path);
        
    private:
        ros::NodeHandle nh_;
        ros::Publisher ploygonPub_;
        ros::Publisher startPointPub_;
        ros::Publisher pathPub_;
        ros::Publisher edgePathPub_;

        boost::shared_ptr<MapBase> mapHandlerPtr_;
        boost::shared_ptr<SmoothBase> smoothPathPtr_;
        boost::shared_ptr<ccpp::EdgePathPlanner> edgePathPlanner_;
        boost::shared_ptr<ccpp::SprialPathPlanner> sprialPathPlanner_;
};

};  //namespace

#endif


